package com.dkd.manage.service.impl;

import java.util.List;
import com.dkd.common.utils.DateUtils;
import com.dkd.manage.domain.Building;
import com.dkd.manage.mapper.BuildingMapper;
import com.dkd.manage.service.IBuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 楼盘信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-11
 */
@Service
public class BuildingServiceImpl implements IBuildingService
{
    @Autowired
    private BuildingMapper buildingMapper;

    /**
     * 查询楼盘信息
     * 
     * @param id 楼盘信息主键
     * @return 楼盘信息
     */
    @Override
    public Building selectBuildingById(Long id)
    {
        return buildingMapper.selectBuildingById(id);
    }

    /**
     * 查询楼盘信息列表
     * 
     * @param building 楼盘信息
     * @return 楼盘信息
     */
    @Override
    public List<Building> selectBuildingList(Building building)
    {
        return buildingMapper.selectBuildingList(building);
    }

    /**
     * 新增楼盘信息
     * 
     * @param building 楼盘信息
     * @return 结果
     */
    @Override
    public int insertBuilding(Building building)
    {
        building.setCreateTime(DateUtils.getNowDate());
        return buildingMapper.insertBuilding(building);
    }

    /**
     * 修改楼盘信息
     * 
     * @param building 楼盘信息
     * @return 结果
     */
    @Override
    public int updateBuilding(Building building)
    {
        building.setUpdateTime(DateUtils.getNowDate());
        return buildingMapper.updateBuilding(building);
    }

    /**
     * 批量删除楼盘信息
     * 
     * @param ids 需要删除的楼盘信息主键
     * @return 结果
     */
    @Override
    public int deleteBuildingByIds(Long[] ids)
    {
        return buildingMapper.deleteBuildingByIds(ids);
    }

    /**
     * 删除楼盘信息信息
     * 
     * @param id 楼盘信息主键
     * @return 结果
     */
    @Override
    public int deleteBuildingById(Long id)
    {
        return buildingMapper.deleteBuildingById(id);
    }

    @Override
    public List<Building> queryBuildingIndoByName(String buildingName) {
        return buildingMapper.queryBuildingIndoByName(buildingName);
    }
}
